import axios from 'axios'

const request = axios.create({
  // baseURL: 'http://47.122.55.184:9080',  // 大创
  // baseURL: "http://124.71.70.169:9080",//加贝
    // baseURL:"http://127.0.0.1:9080",//本地
    baseURL: 'http://47.122.55.184:9080',  // 修改这里
    timeout: 5000
})

// 添加请求拦截器的日志
request.interceptors.request.use(
  config => {
    console.log('发送请求:', config)
    return config
  },
  error => {
    console.log('请求错误:', error)
    return Promise.reject(error)
  }
)

// 添加响应拦截器的日志
request.interceptors.response.use(
  response => {
    console.log('收到响应:', response)
    return response
  },
  error => {
    console.log('响应错误:', error)
    return Promise.reject(error)
  }
)

export default request 